package com.bigzero.workflow.common.properties;

import lombok.Data;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * Redisson 单机配置属性
 *
 * @author fanxinxiong
 * @since 2025-02-10
 */
@Data
@Component
public class SingleServerConfigProperties {

    /**命令等待超时,单位:毫秒*/
    @Value("${spring.redisson.config.singleServerConfig.timeout:#{3000}}")
    private int timeout;

    /**单位:毫秒*/
    @Value("${spring.redisson.config.singleServerConfig.connectTimeout:#{10000}}")
    private int connectTimeout;

    @Value("${spring.redisson.config.singleServerConfig.retryAttempts:#{3}}")
    private int retryAttempts;

    @Value("${spring.redisson.config.singleServerConfig.retryInterval:#{1500}}")
    private int retryInterval;

    /**客户端名称*/
    @Value("${spring.redisson.config.singleServerConfig.clientName:#{null}}")
    private String clientName;

    /**连接空闲超时,单位:毫秒*/
    @Value("${spring.redisson.config.singleServerConfig.idleConnectionTimeout:#{5}}")
    private int idleConnectionTimeout;

    /**发布和订阅连接池大小*/
    @Value("${spring.redisson.config.singleServerConfig.subscriptionConnectionPoolSize:#{10000}}")
    private int subscriptionConnectionPoolSize;

    /**最小空闲连接数*/
    @Value("${spring.redisson.config.singleServerConfig.connectionMinimumIdleSize:#{16}}")
    private int connectionMinimumIdleSize;

    /**连接池大小*/
    @Value("${spring.redisson.config.singleServerConfig.connectionPoolSize:#{32}}")
    private int connectionPoolSize;

    /**地址*/
    @Value("${spring.redisson.config.singleServerConfig.address:#{redis://127.0.0.1:6379}}")
    private String address;
    /**密码*/
    @Value("${spring.redisson.config.singleServerConfig.password:#{123456}}")
    private String password;
}
